package com.shbt.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.annotation.Generated;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TReleaseSell entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_release_sell", catalog = "default_schema")
public class TReleaseSell implements java.io.Serializable {

	// Fields

	private Integer id ;
	private TBookRank TBookRank;
	private TPayBack TPayBack;
	private TUser TUser;
	private TBookType TBookType;
	private String releaseSellCode;
	private Date createTime;
	private Date modifyTime;
	private String sentAddress;
	private String paymentMode;
	private String deliverMode;
	private Integer browseCount;
	private Integer commentCount;
	private String bookTitle;
	private String isbn;
	private Double price;
	private String publish;
	private String author;
	private Integer amount;
	private Set<TReleaseSellComment> TReleaseSellComments = new HashSet<TReleaseSellComment>(
			0);
	private Set<TReleaseSellMoney> TReleaseSellMoneies = new HashSet<TReleaseSellMoney>(
			0);
	private Set<TReleaseSellGoods> TReleaseSellGoodses = new HashSet<TReleaseSellGoods>(
			0);

	// Constructors

	/** default constructor */
	public TReleaseSell() {
	}

	/** minimal constructor */
	public TReleaseSell(Integer id, TBookRank TBookRank, TPayBack TPayBack,
			TUser TUser, TBookType TBookType) {
		this.id = id;
		this.TBookRank = TBookRank;
		this.TPayBack = TPayBack;
		this.TUser = TUser;
		this.TBookType = TBookType;
	}

	/** full constructor */
	public TReleaseSell(Integer id, TBookRank TBookRank, TPayBack TPayBack,
			TUser TUser, TBookType TBookType, String releaseSellCode,
			Date createTime, Date modifyTime, String sentAddress,
			String paymentMode, String deliverMode, Integer browseCount,
			Integer commentCount, String bookTitle, String isbn, Double price,
			String publish, String author, Integer amount,
			Set<TReleaseSellComment> TReleaseSellComments,
			Set<TReleaseSellMoney> TReleaseSellMoneies,
			Set<TReleaseSellGoods> TReleaseSellGoodses) {
		this.id = id;
		this.TBookRank = TBookRank;
		this.TPayBack = TPayBack;
		this.TUser = TUser;
		this.TBookType = TBookType;
		this.releaseSellCode = releaseSellCode;
		this.createTime = createTime;
		this.modifyTime = modifyTime;
		this.sentAddress = sentAddress;
		this.paymentMode = paymentMode;
		this.deliverMode = deliverMode;
		this.browseCount = browseCount;
		this.commentCount = commentCount;
		this.bookTitle = bookTitle;
		this.isbn = isbn;
		this.price = price;
		this.publish = publish;
		this.author = author;
		this.amount = amount;
		this.TReleaseSellComments = TReleaseSellComments;
		this.TReleaseSellMoneies = TReleaseSellMoneies;
		this.TReleaseSellGoodses = TReleaseSellGoodses;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "t_book_rank_id", nullable = false)
	public TBookRank getTBookRank() {
		return this.TBookRank;
	}

	public void setTBookRank(TBookRank TBookRank) {
		this.TBookRank = TBookRank;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "t_pay_back_id", nullable = false)
	public TPayBack getTPayBack() {
		return this.TPayBack;
	}

	public void setTPayBack(TPayBack TPayBack) {
		this.TPayBack = TPayBack;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "t_user_id", nullable = false)
	public TUser getTUser() {
		return this.TUser;
	}

	public void setTUser(TUser TUser) {
		this.TUser = TUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "t_book_type_id", nullable = false)
	public TBookType getTBookType() {
		return this.TBookType;
	}

	public void setTBookType(TBookType TBookType) {
		this.TBookType = TBookType;
	}

	@Column(name = "release_sell_code", length = 20)
	public String getReleaseSellCode() {
		return this.releaseSellCode;
	}

	public void setReleaseSellCode(String releaseSellCode) {
		this.releaseSellCode = releaseSellCode;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "create_time", length = 10)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "modify_time", length = 10)
	public Date getModifyTime() {
		return this.modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	@Column(name = "sent_address", length = 100)
	public String getSentAddress() {
		return this.sentAddress;
	}

	public void setSentAddress(String sentAddress) {
		this.sentAddress = sentAddress;
	}

	@Column(name = "payment_mode", length = 20)
	public String getPaymentMode() {
		return this.paymentMode;
	}

	public void setPaymentMode(String paymentMode) {
		this.paymentMode = paymentMode;
	}

	@Column(name = "deliver_mode", length = 20)
	public String getDeliverMode() {
		return this.deliverMode;
	}

	public void setDeliverMode(String deliverMode) {
		this.deliverMode = deliverMode;
	}

	@Column(name = "browse_count")
	public Integer getBrowseCount() {
		return this.browseCount;
	}

	public void setBrowseCount(Integer browseCount) {
		this.browseCount = browseCount;
	}

	@Column(name = "comment_count")
	public Integer getCommentCount() {
		return this.commentCount;
	}

	public void setCommentCount(Integer commentCount) {
		this.commentCount = commentCount;
	}

	@Column(name = "book_title", length = 50)
	public String getBookTitle() {
		return this.bookTitle;
	}

	public void setBookTitle(String bookTitle) {
		this.bookTitle = bookTitle;
	}

	@Column(name = "isbn", length = 50)
	public String getIsbn() {
		return this.isbn;
	}

	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}

	@Column(name = "price", precision = 22, scale = 0)
	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	@Column(name = "publish", length = 50)
	public String getPublish() {
		return this.publish;
	}

	public void setPublish(String publish) {
		this.publish = publish;
	}

	@Column(name = "author", length = 20)
	public String getAuthor() {
		return this.author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	@Column(name = "amount")
	public Integer getAmount() {
		return this.amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TReleaseSell")
	public Set<TReleaseSellComment> getTReleaseSellComments() {
		return this.TReleaseSellComments;
	}

	public void setTReleaseSellComments(
			Set<TReleaseSellComment> TReleaseSellComments) {
		this.TReleaseSellComments = TReleaseSellComments;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TReleaseSell")
	public Set<TReleaseSellMoney> getTReleaseSellMoneies() {
		return this.TReleaseSellMoneies;
	}

	public void setTReleaseSellMoneies(
			Set<TReleaseSellMoney> TReleaseSellMoneies) {
		this.TReleaseSellMoneies = TReleaseSellMoneies;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TReleaseSell")
	public Set<TReleaseSellGoods> getTReleaseSellGoodses() {
		return this.TReleaseSellGoodses;
	}

	public void setTReleaseSellGoodses(
			Set<TReleaseSellGoods> TReleaseSellGoodses) {
		this.TReleaseSellGoodses = TReleaseSellGoodses;
	}

}